package com.ynr.common.utils;

import redis.clients.jedis.Jedis;

public class RedisTools {
	
	private static final String HOST = "106.75.240.254";
	private static final int PORT = 6379;
	private static final String AUTH = "Cckzcbm110";
	
	public static void insert(String key, String value) {
		Jedis jedis = new Jedis(HOST, PORT);
		jedis.auth(AUTH);
		jedis.select(4);
		jedis.set(key, value);
		jedis.close();
	}
	
	public static String select(String key) {
		Jedis jedis = new Jedis(HOST, PORT);
		jedis.auth(AUTH);
		jedis.select(4);
		String result = jedis.get(key);
		jedis.close();
		return result;
	}
	
	public static void main(String[] args ) {
	}
}
